Published
Edited
Sep 27, 2021
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
majorsData
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(majorsData)
.encode(
//Code here -- be careful with aggregating the data across the years
)
.render()
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(majorsData)
.encode(
//Code here
)
.render()
Insert cell
Insert cell
Insert cell
vl.markPoint({filled: true}) // What happens if filled is false? What is the default?
.data(majorsData)
.encode(
// Code here
)
.render()
Insert cell
Insert cell
Insert cell
vl.markPoint({filled: true})
.data(majorsData)
.encode(
// Code here
)
.render()
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(majorsData)
.encode(
//Code Here
)
.render()

Insert cell
Insert cell
Insert cell
vl.markBar()
.data(majorsData)
.encode(
//Code here -- After making the bar chart as above, try normalizing the bars to cover the full range of the y-axis
)
.render()
Insert cell
Insert cell
Insert cell
vl.markArea()
.data(majorsData)
.encode(
// Code here -- again try normalizing the data on the y-axis.
vl.tooltip(['Subject', 'Number of Students'])
)
.render()
Insert cell
Insert cell
Insert cell
vl.markLine()
.data(majorsData)
.encode(
// Code here
vl.tooltip(['Subject', 'Number of Students'])
)
.render()
Insert cell
Insert cell
Insert cell
vl.markRect()
.data(majorsData)
.encode(
//Code here
)
.render()
Insert cell
Insert cell
Insert cell
vl.markCircle()
.data(majorsData)
.encode(
//Code here
)
.render()
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(majorsData)
.encode(
//Code here
)
// .width(130)
.render()
Insert cell
Insert cell
Insert cell
vl.markArc({"stroke": "#fff"}) //What does setting this stroke property do? Try removing it here.
.data(majorsData)
.encode(
//Code here
vl.tooltip(['Year', 'Number of Students'])
)
.render()
Insert cell
Insert cell
Insert cell
vl.markArc({"stroke": "#fff"})
.data(majorsData)
.encode(
//Code here
vl.tooltip(['Subject', 'Number of Students'])
)
.render()
Insert cell
Insert cell
Insert cell
viewof test = vl.markPoint()
.data(majorsData)
.transform(
//Code the pivot here
vl.pivot(/* data field */).value(/* data field*/).groupby([/*data field*/])
)
.encode(
//Code here
vl.tooltip("StartYear")
)
.render()
Insert cell
//Use this to visualize the data before and after the pivot. source_0 is the source data, data_0 is the pivoted data
vegaDataViewer(test, {dataset: "source_0"})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more